import React, { useState } from 'react';
import { Descriptions, Modal, TreeSelect } from 'antd';


export interface DetailModelProps {
    modalVisible: boolean;
    values: API.PatrolJob;
    onCancel: () => void;
}


const DetailModel: React.FC<DetailModelProps> = (props) => {

    const [formVals] = useState<API.PatrolRecord>(props.values);
    const { modalVisible, onCancel } = props;

    return (
        <Modal
            width={640}
            destroyOnClose
            title="任务详情"
            visible={modalVisible}
            footer={false}
            onCancel={() => onCancel()}
        >
            <Descriptions column={1} >
                <Descriptions.Item label="任务名称">{formVals.jobName}</Descriptions.Item>
                <Descriptions.Item label="巡检人">{formVals.userName}</Descriptions.Item>
                <Descriptions.Item label="巡检时间">{formVals.patrolTime}</Descriptions.Item>
                <Descriptions.Item label="值班领导">{formVals.dutyLeaderName}</Descriptions.Item>
                <Descriptions.Item label="领导是否确认">{formVals.isConform==1?'是':'否'}</Descriptions.Item>
                <Descriptions.Item label="处理意见">{formVals.comment}</Descriptions.Item>
            </Descriptions>
        </Modal>
    );
};

export default DetailModel;
